#include <glog/logging.h>

class LogSink : public google::LogSink
{
  virtual void
  send (google::LogSeverity severity, const char *full_filename,
        const char *base_filename, int line,
        const google::LogMessageTime &time, const char *message,
        size_t message_len)
  {
    fprintf (stderr, "Custom Sink %s: %*s",
             google::GetLogSeverityName (severity), (int)message_len, message);
    fflush (stderr);
  }
};

int
main (int argc, char *argv[])
{
  google::InitGoogleLogging (argv[0]);
  google::AddLogSink (new LogSink);
  google::LogToStderr ();
  LOG (INFO) << "Hello world!";
  return 0;
}
